// 模型配置相关接口

import services from '../createServices';
import { servicesNoVersion } from '../createServices';

// 模型
export const model = {
  add: (params) => services.post('/model/add', { params, isLoading: true }),
  delete: (params) => servicesNoVersion.post('/v2/model/delete', { params, isLoading: true }),
  list: (params) => servicesNoVersion.post('/v2/model/list', { params, isLoading: true }),
  strategyModel: (params) => servicesNoVersion.post('/v2/model/strategy-model', { params }),
  getParamsMapRelation: (params) => services.post('/model/get-params-map-relation', { params }),
  paramsMap: (params) => servicesNoVersion.post('/v2/model/params-map', { params }),
  getParticipationParams: (params) => servicesNoVersion.post('/v2/model/get-participation-params', { params }),
  testModel: (params) => servicesNoVersion.post('/v2/model/test-model', { params }),
  detail: (params) => services.post('/model/detail', { params }),
  parameter: (params) => servicesNoVersion.post('/v2/model/get-participation-params', { params, isLoading: true }),
  testUrl: (params) => services.post('/model/test-url', { params }),
  repositoryList: (params) => services.post('/model-repository/list', { params }),
  addByCite: (params) => servicesNoVersion.post('/v2/model/add-by-cite', { params }),
  addByService: (params) => servicesNoVersion.post('/v2/model/add-by-service', { params }),
  getFieldFeature: (params) => services.post('/model/get-field-feature', { params }),
  exist: (params) => services.post('/file/exist', { params }),
  nameList: (params) => servicesNoVersion.post('/v2/model-config/name-list', { params }),
  intelligent: (params) => servicesNoVersion.post('/v2/model/intelligent-mapping', { params }),
  mapEvent: (params) => servicesNoVersion.post('/v2/model/check-map-repeat', { params, isLoading: true }),
  paramsMapEdit: (params) => servicesNoVersion.post('/v2/model/params-map-edit', { params, isLoading: true }),
  deleteParamsMap: (params) => servicesNoVersion.post('/v2/model/delete-params-map', { params, isLoading: true }),
  getListMap: (params) => servicesNoVersion.post('/v2/model/get-list-map', { params, isLoading: true }),
};
// 模型仓库
export const repositoryModel = {
  list: (params) => servicesNoVersion.post('/v2/model-repository/list', { params, isLoading: true }),
  delete: (params) => servicesNoVersion.post('/v2/model-repository/delete', { params, isLoading: true }),
  detail: (params) => servicesNoVersion.post('/v2/model-repository/detail', { params, isLoading: true }),
  getVersions: (params) => servicesNoVersion.post('/v2/model-repository/get-versions', { params, isLoading: true }),
  create: (params) => servicesNoVersion.post('/v2/model-repository/create', { params, isLoading: true }),
  upload: (params) => servicesNoVersion.upload('/v2/model-repository/upload', { params, isLoading: true }),
  nameList: (params) => servicesNoVersion.upload('/v2/model-repository/name-list', { params, isLoading: true }),
  downLoad: (params) => servicesNoVersion.post('/v2/model-repository/model-download', { params, isLoading: true }),
  deploy: (params) => servicesNoVersion.post('/v2/model-repository/deploy', { params, isLoading: true }),
  allList: (params) => servicesNoVersion.post('/v2/model-repository/all-list', { params }),
};

// 模型配置
export const modelConfig = {
  list: (params) => servicesNoVersion.post('/v2/model-config/list', { params, isLoading: true }),
  delete: (params) => servicesNoVersion.post('/v2/model-config/delete', { params, isLoading: true }),
  detail: (params) => services.post('/model-config/detail', { params, isLoading: true }),
  parameter: (params) => servicesNoVersion.post('/v2/model/get-in-out-params', { params, isLoading: true }),
  create: (params) => services.post('/model-config/create', { params, isLoading: true }),
  testModel: (params) => servicesNoVersion.post('/v2/model/test-model', { params }),
};

// 模型服务测试
export const modelParamTest = {
  testModel: (params) => servicesNoVersion.post('/v2/model/test-model', { params }),
  detail: (params) => servicesNoVersion.post('/v2/model/get-in-out-params', { params, isLoading: true }),
};
